<template>
    <div>
        <ul class="mui-table-view">
            <!-- <li class="mui-table-view-cell mui-media" v-for="item in newslist" :key="item.id">
                <router-link to="'/home/newsinfo/' + item.id">
                    <img class="mui-media-object mui-pull-left" :src="item.img_url">
                    <div class="mui-media-body">
                        <h1>{{item.title}}</h1>
                        <p class='mui-ellipsis'>
                            <span>{{item.add_time | dateFormat('YYYY-MM-DD')}}</span>
                            <span>{{item.click}}</span>
                        </p>
                    </div>
                </router-link>
            </li> -->
            <li class="mui-table-view-cell mui-media" v-for="item in newslist" :key="item.id">
                <router-link :to="'/home/newsinfo/'+item.id">
                    <!-- <img class="mui-media-object mui-pull-left" :src="item.img_url"> -->
                    <img class="mui-media-object mui-pull-left" src="../../images/menu1.png">
                    <div class="mui-media-body">
                        <h1>{{item.title}}</h1>
                        <p class='mui-ellipsis'>
                            <span>{{item.add_time | dateFormat('YYYY-MM-DD')}}</span>
                            <span>{{item.click}}</span>
                        </p>
                    </div>
                </router-link>
            </li>
		</ul>
    </div>
</template>

<script>

import {Toast} from 'mint-ui'

export default {
    data(){
        return {
            // newslist: [] //新闻列表
            newslist: [
                {
                    id: 1,
                    title: '58名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-04 02:49:50',
                    click: 45
                },
                {
                    id: 2,
                    title: '57名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-05 02:49:50',
                    click: 44
                },
                {
                    id: 3,
                    title: '58名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-04 02:49:50',
                    click: 45
                },
                {
                    id: 4,
                    title: '58名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-04 02:49:50',
                    click: 145
                },
                {
                    id: 5,
                    title: '58名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-04 02:49:50',
                    click: 245
                },
                {
                    id: 6,
                    title: '58名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-04 02:49:50',
                    click: 345
                },
                {
                    id: 7,
                    title: '58名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-04 02:49:50',
                    click: 445
                },
                {
                    id: 8,
                    title: '58名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-04 02:49:50',
                    click: 745
                },
                {
                    id: 9,
                    title: '58名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-04 02:49:50',
                    click: 7645
                },
                {
                    id: 10,
                    title: '58名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-04 02:49:50',
                    click: 9045
                },
                {
                    id: 11,
                    title: '58名支教美女老师被抓 真实身份惊人',
                    img_url: '../../images/menu1.png',
                    add_time: '2018-04-04 02:49:50',
                    click: 435
                }
            ] //新闻列表
        }
    },
    created() {
        // this.getNewsList()
    },
    methods: {
        // getNewsList(){ //获取新闻列表
        //     this.$http.get("api/getnewslist").then(result => {
        //        if(reslut.body.status === 0){
        //            this.newslist = result.body.message
        //        }else {
        //            Toast('获取新闻列表失败')
        //        }
        //     })
        // }
    }
}
</script>

<style lang="scss" scoped>
   .mui-table-view {
       li {
           h1 {
               font-size: 14px;
           }

           .mui-ellipsis {
               font-size: 12px;
               color: #226aff;
               display: flex;
               justify-content: space-between;
           }
       }
   }
</style>

